package com.automobile.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.automobile.dao.SiteDao;
import com.automobile.domain.Site;
import com.automobile.service.SiteService;

/**
 * 地址操作，本项目没有用到
 */
@Service("siteService")
public class SiteServiceImpl implements SiteService{
	
	@Autowired
	private SiteDao siteDao;
	
	/*
	 * 用户查看自己的收获地址
	 */
	public List<Site> findUserAddress(int userId) {
		List<Site> sites = siteDao.findSiteByUserId(userId);
		return sites;
	}

	/*
	 * 修改地址时需要先获取信息
	 */
	public Site findSiteById(int siteId) {
		Site site = siteDao.findSiteById(siteId);
		return site;
	}

	public void save(Site site) {
		siteDao.save(site);
	}

	public void update(Site site) {
		siteDao.update(site);
	}

	public void delete(int id) {
		siteDao.delete(id);
	}

	
}
